import { IContext, IParam } from '@/core';
import { PropType } from 'vue';
declare type methodType = 'post' | 'POST' | 'PUT' | 'PATCH' | 'put' | 'patch';
declare type listType = 'text' | 'picture' | 'picture-card';
export const uploadProps = {
	name: {
		type: String,
	},
	value: {
		type: String,
	},
	//接收文件类型
	accept: {
		type: String,
		default: '*',
	},
	//上传请求的 http 方法
	method: {
		type: String as PropType<methodType>,
		default: 'post',
	},
	//文件是否多选
	multiple: {
		type: Boolean,
		default: true,
	},
	//是否展示文件列表
	showUploadList: {
		type: Boolean,
		default: true,
	},
	//限制上传数量。当为 1 时，始终用最新上传的文件代替当前文件
	maxCount: {
		type: Number,
		default: 999,
	},
	//文件列表样式
	listType: {
		type: String as PropType<listType>,
		default: 'text',
	},
	readonly: {
		type: Boolean,
		default: false,
	},
	disabled: {
		type: Boolean,
		default: false,
	},
	//图片加载失败时显示容错图片地址
	fallback: {
		type: String,
		default: '',
	},
	uploadparams: {
		type: Object as PropType<IParam>,
		default: {},
	},
	exportparams: {
		type: Object as PropType<IParam>,
		default: {},
	},
	//是否允许预览
	rowPreview: {
		type: Boolean,
		default: true,
	},
	imageOnly: {
		type: Boolean,
		default: false,
	},
	pdfOnly: {
		type: Boolean,
		default: false,
	},
	formSubject: {
		type: Object,
	},
	data: {
		type: Object,
	},
	viewParams: {
		type: Object as PropType<IParam>,
	},
	context: {
		type: Object as PropType<IContext>,
	},
	isdrop: {
		type: Boolean,
		default: true,
	},
	tooltip: {
		type: String,
	},
};
